<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
pageContext.setAttribute("basePath",basePath);
%>
<!DOCTYPE html>
<html lang="zh-cn">
	<head>
		<meta charset="UTF-8">
		<title>用户信息详情页</title>

		<link rel="stylesheet" type="text/css" href="${basePath}resources/bootstrap/css/bootstrap-responsive.css">
		<link rel="stylesheet" type="text/css" href="${basePath}resources/bootstrap/css/bootstrap.css">
		<link rel="stylesheet" type="text/css" href="${basePath}resources/css/basic.css">
		<link rel="stylesheet" type="text/css" href="${basePath}resources/css/login.css">

		<script type="text/javascript" src="${basePath}resources/js/common/base.js"></script>
		<script type="text/javascript" src="${basePath}resources/js/common/jquery-3.2.1.min.js"></script>
		<script type="text/javascript" src="${basePath}resources/bootstrap/js/bootstrap.js"></script>
		<script type="text/javascript" src="${basePath}resources/angular-1.3.0/angular.min.js"></script>
		<script type="text/javascript" src="${basePath}resources/js/common/jquery-3.2.1.min.js"></script>
		<script type="text/javascript" src="${basePath}resources/js/update_selfinfo.js"></script>
	</head>
	<body ng-app="myApp" ng-controller="updateSelfInfoController">
		<div id="header">
			<%@ include file="common/header.jsp" %>
		</div>
		<div id="container">
			<div>
				<table class="table">
					<h2><caption>用户信息详情页</caption></h2>
					<tbody>
						<tr>
							<td>用户名</td>
							<td>${user.username}</td>
						</tr>
						<tr>
							<td>真实姓名</td>
							<td>${user.truename}</td>
						</tr>
						<tr>
							<td>头像</td>
							<c:if test="${user.photoUrl != null}">
								<td><img style="height: 80px; width:80px;" src="${user.photoUrl}" alt="头像"></td>
							</c:if>
						</tr>
						<tr>
							<td>性别</td>
							<c:if test="${user.gender == 1}">
								<td>男</td>
							</c:if>
							<c:if test="${user.gender == 2}">
								<td>女</td>
							</c:if>
						</tr>
						<tr>
							<td>电话</td>
							<td>${user.phone}</td>
						</tr>
						<tr>
							<td>email</td>
							<td>${user.email}</td>
						</tr>
						<tr>
							<td>工作</td>
							<td>${user.job}</td>
						</tr>
						<tr>
							<td>创建时间</td>
							<td>${user.createTime}</td>
						</tr>
					</tbody>
				</table>
				<hr>
				<c:if test="${examList != null}">
					<table class="table">
						<tr>
							<th>考试号</th>
							<th>得分</th>
							<th>结束时间</th>
							<th>开始时间</th>
							<th>操作</th>
						</tr>
						<c:forEach items="${examList }" var="exam">
							<tr>
								<td>${exam.examId }</td>
								<td>${exam.score }</td>
								<td>${exam.startTime }</td>
								<td>${exam.endTime }</td>
								<td>
									<a href="${basePath}exam/detail/${exam.examId}">查看详情</a>
								</td>
							</tr>
						</c:forEach>
					</table>
				</c:if>
				<c:if test="${examList == null}">
					<div>还未考过试!</div>
				</c:if>
			</div>
		</div>
		<div id="footer">
			<%@ include file="common/footer.jsp" %>
		</div>
	</body>
</html>